Skip to content

Add 2 missing validation rules#71

Open
abhinaverma97 wants to merge 1 commit intosbgn:masterfrom
abhinaverma97:feature/add-missing-pd-rules
Open

Add 2 missing validation rules#71
abhinaverma97 wants to merge 1 commit intosbgn:masterfrom
abhinaverma97:feature/add-missing-pd-rules

Conversation

@abhinaverma97
Copy link

Summary

This PR implements two validation rules that were specified in the SBGN Process Description (PD) Level 1 Version 2.0 specification but were missing from the existing sbgn_pd.sch Schematron rules.

New rules added:

  • pd10143: Enforce unique state variables per EPN.
  • pd10144: Limit catalysis arcs to at most one per process.

Detailed Changes

Rule: Unique State Variables per EPN (pd10143)

Spec Reference: Section 3.5.1, Rule 1

"All state variables associated with a Stateful Entity Pool Node should be unique and not duplicated within that node."

Implementation:
Checks that the count of state variables equals the count of distinct state variables within a stateful EPN.

Example Violation:

<glyph id="protein1" class="macromolecule">
    <label text="EGFR"/>
    <state value="P" variable="S122"/>
    <state value="P" variable="S122"/> <!-- ERROR -->
</glyph>

Rule: At Most One Catalysis Per Process (pd10144)

Spec Reference: Section 3.5.2.4, Rule 8

"At most one catalysis can be assigned to a process... two catalysis cannot be assigned to the same process node as they represent independent reactions."

Implementation:
Checks that the number of catalysis arcs targeting a specific process (or its ports) is less than or equal to 1.

Example Violation:

<arc id="cat1" class="catalysis" source="enzyme1" target="process1"/>
<arc id="cat2" class="catalysis" source="enzyme2" target="process1"/> <!-- ERROR -->

Verification

I verified these changes by creating specific test files containing these violations and running the Ant validation target (ant schematron-validate-dir).

Test Results:

  1. Duplicate State Variables: Correctly triggered pd10143.
    • Diagnostic: state-count - 2, unique-count - 1
  2. Multiple Catalysis: Correctly triggered pd10144.
    • Diagnostic: catalysis-count - 2

Existing tests passed successfully.

- pd10143: Enforce unique state variables per EPN (Spec 3.5.1.1)
- pd10144: Limit catalysis arcs to one per process (Spec 3.5.2.4.8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant